Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel touch events when treating them as mouse events #1172

Merged
merged 1 commit into from
Jan 26, 2018

Conversation

starwed
Copy link
Member

@starwed starwed commented Jan 21, 2018

While doing some cross-browser testing, I noticed that Crafty's mouse events were being triggered twice on mobile. I'm fairly certain this is because the browser was also mapping touch events to mouse events.

The best solution seems to be to call preventDefault() on the touch event when forwarding to the mouse system. I believe that when Crafty itself handles touch/mouse this is already done; it's just missing when we forward touch events to mouse events.

Tagging @mucaho since he's done much more work the touch/mouse systems than I have.

@starwed starwed merged commit 69762bc into craftyjs:develop Jan 26, 2018
@starwed starwed deleted the touch-dispatch-prevent-default branch January 26, 2018 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants